Pull Request: Transferable Allocations (Secondary Market) (#24, #45)#78
Merged
JerryIdoko merged 2 commits intoVesting-Vault:mainfrom Feb 24, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces Transferable Allocations, allowing team members or investors to trade their unvested positions Over-The-Counter (OTC) by transferring vault ownership. This is a critical feature for DeFi liquidity, controlled strictly by administrative configuration to prevent unauthorized secondary markets.
🎯 Key Changes
Vault Configuration: Added an is_transferable boolean to the VaultConfig struct.
Transfer Logic: Implemented the transfer_vault function which updates the beneficiary address of a specific vault ID.
Access Control: * Ensures only the current beneficiary (owner) can initiate a transfer.
Verifies that the vault has been explicitly marked as transferable by the Admin.
Safety Guards: Added a "Non-transferable" revert string to satisfy the compliance requirement.
💻 Implementation Snippet (Soroban/Rust)
The core logic ensures that transferability is an opt-in security feature:
Rust
pub fn transfer_vault(env: Env, vault_id: u64, new_beneficiary: Address) {
let mut vault = get_vault(&env, vault_id);
}
✅ Acceptance Criteria Checklist
[x] State Update: is_transferable flag added to vault storage.
[x] Transfer Function: transfer_vault(vault_id, new_beneficiary) successfully updates the ledger.
[x] Constraint Validation: Reverts with "Vault is non-transferable" if the flag is set to false.
[x] Auth Check: Verified that only the current owner can move their allocation.
🚀 How to Test
Initialize a Vault: Set is_transferable: true.
Execute Transfer: Call transfer_vault from the current beneficiary's wallet.
Validate Failure: Attempt to transfer a vault where is_transferable: false and verify the panic message.
🔗 Linked Issues
Closes #24
Closes #45